Skip to content

feat: Simplify the access to the editor in the fact-checking workflow#2046

Open
thesocialdev wants to merge 9 commits intostagefrom
feature/centralized-rbac-permission-system
Open

feat: Simplify the access to the editor in the fact-checking workflow#2046
thesocialdev wants to merge 9 commits intostagefrom
feature/centralized-rbac-permission-system

Conversation

@thesocialdev
Copy link
Collaborator

Summary

  • Implement centralized permission system with useReviewTaskPermissions hook for consistent RBAC across the application
  • Add cross-checking comment rejection workflow with confirmRejection event and proper translations
  • Fix visual editor filtering to exclude unnecessary fields from specific review events
  • Enhance UX with improved header chips, user name resolution, and conditional display logic

Key Features

  • Centralized RBAC: New useReviewTaskPermissions hook consolidates all permission logic
  • Enhanced Workflows: Added rejection confirmation workflow with proper form handling
  • Better UX: Header chips now show user names instead of IDs and hide when reports are published
  • Debug Mode: Comprehensive debug mode for testing different user scenarios (disabled in production)
  • Visual Editor Fixes: Proper field filtering prevents undefined function errors in cross-checking events

Technical Improvements

  • Fixed TypeError: event.reviewData.visualEditor.toJSON is not a function by filtering visual editor from comment-only events
  • Resolved state.reported not showing actions for assigned fact-checkers through centralized permissions
  • Added comprehensive documentation for permission system architecture

Test plan

  • Verify cross-checking comment submission works without errors
  • Confirm assigned fact-checkers can see appropriate actions in reported state
  • Test header chips display user names and hide when reports are published
  • Validate rejection workflow with confirmation dialog
  • Ensure debug mode is disabled in production builds

🤖 Generated with Claude Code

@caneppelevitor
Copy link
Collaborator

@thesocialdev I still need more time to properly review this PR, specially for the cypress erros that we are getting

@thesocialdev thesocialdev changed the title feat: Centralized RBAC Permission System with Enhanced UX feat: Simplify the access to the editor in the fact-checking workflow Oct 13, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
24.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@caneppelevitor caneppelevitor force-pushed the feature/centralized-rbac-permission-system branch from 8d61b28 to cfae37b Compare February 20, 2026 14:08
@caneppelevitor caneppelevitor self-assigned this Feb 20, 2026
thesocialdev and others added 9 commits March 2, 2026 17:50
- Add centralized permission system with useReviewTaskPermissions hook
- Implement cross-checking comment rejection workflow with confirmRejection event
- Fix visual editor filtering to exclude unnecessary fields from specific events
- Add comprehensive debug mode for testing different user scenarios
- Improve header chips readability and hide header when reports are published
- Resolve assignee chips to display user names instead of IDs
- Update translations for new confirmation and rejection workflows
- Add comprehensive documentation for permission system architecture

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- DynamicReviewTaskForm now gets events from state machine (source of truth)
- Use permissions as middleware to filter/check user capabilities
- Permissions no longer override the state machine's event determination
- Maintain proper separation of concerns: state machine defines what's possible, permissions define what's allowed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@caneppelevitor caneppelevitor force-pushed the feature/centralized-rbac-permission-system branch from d63db8c to b59a83f Compare March 2, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants